
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpCemSubtype.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpCemSubtypeForm"
 */
public class CcpCemSubtypeForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _ccsGuid = null;
   private java.lang.String _ccsCode = null;
   private java.lang.String _ccsName = null;
   private java.lang.String _ccoGuid = null;

   /**
    * Standard constructor.
    */
   public CcpCemSubtypeForm() {
   }

   /**
    * Returns the ccsGuid
    *
    * @return the ccsGuid
    */
   public java.lang.String getCcsGuid() {
      return _ccsGuid;
   }

   /**
    * Sets the ccsGuid
    *
    * @param ccsGuid the new ccsGuid value
    */
   public void setCcsGuid(java.lang.String ccsGuid) {
      _ccsGuid = ccsGuid;
   }
   /**
    * Returns the ccsCode
    *
    * @return the ccsCode
    */
   public java.lang.String getCcsCode() {
      return _ccsCode;
   }

   /**
    * Sets the ccsCode
    *
    * @param ccsCode the new ccsCode value
    */
   public void setCcsCode(java.lang.String ccsCode) {
      _ccsCode = ccsCode;
   }
   /**
    * Returns the ccsName
    *
    * @return the ccsName
    */
   public java.lang.String getCcsName() {
      return _ccsName;
   }

   /**
    * Sets the ccsName
    *
    * @param ccsName the new ccsName value
    */
   public void setCcsName(java.lang.String ccsName) {
      _ccsName = ccsName;
   }
   /**
    * Returns the ccoGuid
    *
    * @return the ccoGuid
    */
   public java.lang.String getCcoGuid() {
      return _ccoGuid;
   }

   /**
    * Sets the ccoGuid
    *
    * @param ccoGuid the new ccoGuid value
    */
   public void setCcoGuid(java.lang.String ccoGuid) {
      _ccoGuid = ccoGuid;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCcsGuid() == null) {
         errors.add("ccsGuid", new ActionError("error.ccsGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
